export const testHostname = "public.hterobot.com"
export const hterobotDomain = `oj.hterobot.com`
export const hterobotSaasDomain = `stem.hterobot.com`

export const xhsdSaasHostname = "stem.woowisland.com"
// 码客行
export const mkxDomain = `oj.accoders.cn`
export const mkxSaasDomain = `stem.accoders.cn`

export const adminTeamId = 1004
// 此配置可废弃、按团队上的配置 showRemotejudge 为准
export const showCF = (teamId: number) => {
    const whiteList = [
        adminTeamId, // 哈工科教
        1907, // 首都师范大学附属中学本部 
        1300, // 码客行信息学普及班
        1511, // 海实信息奥赛社团
        1919, // 首都师范大学实验小学
        1912, // 翠微小学
        1963, // 中国人民大学附属小学
        2028, // 嘉祥
    ]
    return false
    return whiteList.includes(teamId)
}

// AI 记录日志相关
export enum AILogMethod {
    All = 'all',
    AiSolution = 'view_ai_solution',
    CodeAssistance = 'code_assistance',
    AIChat = 'AI_Chat',
}
export const AILogTypeCfg = {
    [AILogMethod.All]: { label: "全部", value: AILogMethod.All },
    [AILogMethod.AiSolution]: { label: "AI解题思路", value: AILogMethod.AiSolution },
    [AILogMethod.CodeAssistance]: { label: "代码协助", value: AILogMethod.CodeAssistance },
    [AILogMethod.AIChat]: { label: "AI聊天", value: AILogMethod.AIChat },
}

export enum AILogAction {
    INIT_VIEW = "init_view",
    SWITCH_SOLUTION = "switch_solution",
    VIEW_STEP = "view_step",
    REFRESH_DATA = "refresh_data",

    CODE_ASSISTANCE = "code_assistance",

    SEND_MESSAGE = "send_message",
    RECEIVE_RESPONSE = "receive_response",
}
export const AILogActionCfg = {
    [AILogAction.INIT_VIEW]: { label: "初始查看", value: AILogAction.INIT_VIEW },
    [AILogAction.SWITCH_SOLUTION]: { label: "切换思路", value: AILogAction.SWITCH_SOLUTION },
    [AILogAction.VIEW_STEP]: { label: "查看步骤", value: AILogAction.VIEW_STEP },
    [AILogAction.REFRESH_DATA]: { label: "初始查看", value: AILogAction.REFRESH_DATA },

    [AILogAction.CODE_ASSISTANCE]: { label: "代码协助", value: AILogAction.CODE_ASSISTANCE },
    [AILogAction.SEND_MESSAGE]: { label: "发送消息", value: AILogAction.SEND_MESSAGE },
    [AILogAction.RECEIVE_RESPONSE]: { label: "接收响应", value: AILogAction.RECEIVE_RESPONSE },
}

export enum QuestionType {
    OJ,
    PUBLIC_TEST,
}

export function getThirdLevelDomain() {
    const hostname = window.location.hostname;
    const domains = hostname.split(".");
    const s = new URL(window.location.href).searchParams;
    const teamid = s.get("teamid") ? Number(s.get("teamid")) : undefined;
    return {
        ID: teamid,
        teamkey: teamid ? undefined : (domains.length > 2 ? domains[0] : undefined),
    }
}

export enum LabelType {
    QUESTIONBANK = "题单标签",
    QUESTION = "题目标签",
    VIP = "精选题库标签",
    MATCH = "比赛标签",
}
